﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;

namespace DrivingCRM.Model
{
    public class EFMembershipUser : MembershipUser
    {
        private string _Firstname;
        private string _Lastname;
        private DateTime _DateOfBirth;

        public string Firstname
        {
            get { return _Firstname; }
            set { _Firstname = value; }
        }

        public string Lastname
        {
            get { return _Lastname; }
            set { _Lastname = value; }
        }

        public DateTime DateOfBirth
        {
            get { return _DateOfBirth; }
            set { _DateOfBirth = value; }
        }

        public EFMembershipUser(string providername,
                                string username,
                                object providerUserKey,
                                string email,
                                string passwordQuestion,
                                string comment,
                                bool isApproved,
                                bool isLockedOut,
                                DateTime creationDate,
                                DateTime lastLoginDate,
                                DateTime lastActivityDate,
                                DateTime lastPasswordChangedDate,
                                DateTime lastLockedOutDate,
                                string firstname,
                                string lastname,
                                DateTime? dateOfBirth) :
                                base(providername,
                                       username,
                                       providerUserKey,
                                       email,
                                       passwordQuestion,
                                       comment,
                                       isApproved,
                                       isLockedOut,
                                       creationDate,
                                       lastLoginDate,
                                       lastActivityDate,
                                       lastPasswordChangedDate,
                                       lastLockedOutDate)
        {
            this.Firstname = firstname;
            this.Lastname = lastname;
            if (dateOfBirth.HasValue)
                this.DateOfBirth = dateOfBirth.Value;
            else
                this.DateOfBirth = DateTime.Now;
        }
    }
}